﻿using AnesSystem.Models;
using System.Collections.Generic;
using System.Linq;
using MongoDB.Bson;
using MongoDB.Driver;

namespace AnesSystem.Services
{
    public class PatientLinkCopyService : BaseService<PatientLinkCopyService, PatintLinkCopyModel>
    {
        public List<PatintLinkCopyModel> GetOutRoom()
        {
            var filter = Builders<BsonDocument>.Filter;
            var query = Builders<BsonDocument>.Filter.And(Builders<BsonDocument>.Filter.Eq("PatientLink.Application.Status", Constants.AP_STATUS_MAZUIHOU));
            return FindAll(query).ToList();
        }

        public List<PatintLinkCopyModel> FindByBrxm(string brxm)
        {
            var filter = Builders<BsonDocument>.Filter;
            var query = Builders<BsonDocument>.Filter.And(Builders<BsonDocument>.Filter.Eq("PatientLink.Application.Status", Constants.AP_STATUS_MAZUIHOU),
                Builders<BsonDocument>.Filter.Eq("PatientLink.Patient.Brxm", brxm));
            return FindAll(query).ToList();
        }
    }
}
